﻿using CaseManagerLibrary.Socket;
using PSDLib.Protocols;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace PSDServer.Protocols
{
    public class OpenClientProcessor : ServerMessageProcessor
    {
        public override void Run(PSDServerContext context, TcpClientState state, params object[] args)
        {
            var device = (Message as OpenClientMessage).Device;
            device.device_ip = (state.TcpClient.Client.RemoteEndPoint as IPEndPoint).Address.ToString();
            //device.device_port = (state.Socket.RemoteEndPoint as IPEndPoint).Port;

            context.OpenClient(device);
        }
    }
}
